<%-- 
    Document   : index
    Created on : Feb 8, 2012, 3:39:25 PM
    Author     : haohao
--%>

<%@page import="java.util.List"%>
<%@page import="entity.Product"%>
<%@page import="bus.ProductManager"%>
<%@page import="dal.DBConnection"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.Connection"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <form action="ProductManager">
            <table border="1">
                <%
                            ProductManager pm = new ProductManager();
                            List<Product> list = pm.getAll();
                            for (Product p : list) {
                %>

                <tr>
                    <td style="width: 30px"> <%= p.getId()%> </td>
                    <td style="width: 30px"> <%=p.getName()%> </td>
                    <td style="width: 30px"> <%=p.getAuthor()%> </td>
                    <td><a href="BusProduct?id=<%= p.getId()%>">Add</a></td>
                </tr>
                <%}
                %>
            </table>
        </form>

    </body>
</html>
